<div>
    <button class="layui-btn" style="margin-left: 20px" id="isCheckFun">确认选择</button>
</div>
<table id="itemTable"></table>
<script>
    layui.use(['layer', 'form', 'table', 'admin', 'upload', 'tree', 'laytpl'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var config = layui.config;
        var admin = layui.admin;
        var upload = layui.upload;
        var laytpl = layui.laytpl;
        const id = parentData.id

        if (id) {
            table.render({
                elem: '#itemTable',
                url: config.base + 'enterprise/purchase/admin/purchaseDeliveryRecordProduct/list',
                where: {purchaseDeliveryRecordId: id},
                page: false,
                cellMinWidth: 100,
                cols: [[
                    {type: 'checkbox', fixed: 'left'},
                    {type: 'numbers', height: 50},
                    {field: 'id', title: '采购订单明细ID', hide: 'true'},
                    {
                        field: 'productPic', title: '物料图片', templet: function (d) {
                            return '<img src="' + d.productPic + '" style="height: 40px;" id="platformPic"/>'
                        }
                    },
                    {field: 'skuCode', title: '物料编号'},
                    {field: 'skuSpec', title: '规格号'},
                    {field: 'productTypeName', title: '物料类型'},
                    {field: 'mainUnitName', title: '计价单位'},
                    {field: 'mainUnitRate', title: '主换算率'},
                    {field: 'purchaseQuantity', title: '采购数量'},
                    {field: 'quantity', title: '发货数量'}
                ]]
            });
            $('#isCheckFun').click(() => {
                var checkStatus = table.checkStatus('itemTable'); // 'demo'是表格的ID
                var data = checkStatus.data;  // 选中的数据
                if (typeof parent.layui !== 'undefined') {
                    childData.list = data
                    layer.close(parentData.zindex); // 关闭指定的弹窗
                }

            })
        }

    })
</script>